module game {
	/**
	 * 页面1
	 * @author caizj 2015-08-12
	 *
	 */
	export class SwiperPage111 extends BaseSwiper{
        
        private bg: egret.Bitmap;//背景
        private game_name: egret.Bitmap;//游戏名字文字
        private man_right: egret.Bitmap;
        private man_left: egret.Bitmap;
        
		public constructor() {
            super();
		}
        
        public activate(): void { 
            if(this.isActive) return;
            
            super.activate();
//            console.log("激活page1");
            if(this.bg == null) { 
                this.bg = this.createBitmapByName("page1_bg_png");
                this.addChild(this.bg);
                this.bg.x = this.bg.y = 0;
            }
            if(this.game_name == null) { 
                this.game_name = this.createBitmapByName("page1_game_name");
                this.addChild(this.game_name);           
            }
            this.game_name.x =0;
            this.game_name.y = -500;
            this.game_name.visible = true;
            
            //动画
            egret.Tween.get(this.game_name).to({y:0}, 300,egret.Ease.bounceOut).call(this.onTweenOver, this, [this.game_name]);
            
            //播放入场音效
            this.playSound();
        }
        
        public deactivate(): void { 
            if(!this.isActive) return;
                        
            super.deactivate();
//            console.log("静止page1");
            
            if(this.bg == null) { 
                this.bg = this.createBitmapByName("page1_bg_png");
                this.addChild(this.bg);
            }
            if(this.game_name) { 
                this.game_name.visible = false;
            }
            if(this.man_right) { 
                    this.man_right.visible = false;
            }
            if(this.man_left) { 
                    this.man_left.visible = false;
            }
        }
        
	}
}
